﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_DKHangHoa : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CboGiaBan")]
        private ComboBox _CboGiaBan;
        [AccessedThroughProperty("CboGiaMua")]
        private ComboBox _CboGiaMua;
        [AccessedThroughProperty("CboHangSanXuat")]
        private ComboBox _CboHangSanXuat;
        [AccessedThroughProperty("CboNhom")]
        private ComboBox _CboNhom;
        [AccessedThroughProperty("CboQuocGia")]
        private ComboBox _CboQuocGia;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsDMHangHoa objDMHangHoa;

        public Frm_DKHangHoa()
        {
            base.Load += new EventHandler(this.Frm_DKHangHoa_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.objDMHangHoa = new clsDMHangHoa();
            this.InitializeComponent();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            this.PrintReport();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_DKHangHoa_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                BuildComboModule.BuildCombo(this.CboNhom, modGeneral.ListDanhMuc.NhomHangHoa, true, "", "");
                BuildComboModule.BuildCombo(this.CboQuocGia, modGeneral.ListDanhMuc.QuocGia, true, "", "");
                BuildComboModule.BuildCombo(this.CboHangSanXuat, modGeneral.ListDanhMuc.HangSanXuat, true, "", "");
                BuildComboModule.BuildCombo(this.CboGiaMua, modGeneral.ListDanhMuc.LoaiTien, false, "Ma in (SELECT LoaiTien from MH_NguyenTeGiaDauVao)", "");
                BuildComboModule.BuildCombo(this.CboGiaBan, modGeneral.ListDanhMuc.LoaiGiaBan, false, "", "");
                this.CboGiaMua.SelectedValue = modGeneral.H_CURRENCY;
                this.CboGiaBan.SelectedValue = modGeneral.H_GIACHUAN;
                this.Cursor = Cursors.Default;
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_DKHangHoa));
            this.GroupBox1 = new GroupBox();
            this.Label3 = new Label();
            this.CboGiaBan = new ComboBox();
            this.Label2 = new Label();
            this.CboGiaMua = new ComboBox();
            this.Label25 = new Label();
            this.CboHangSanXuat = new ComboBox();
            this.Label1 = new Label();
            this.CboQuocGia = new ComboBox();
            this.Label18 = new Label();
            this.CboNhom = new ComboBox();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.Panel1 = new Panel();
            this.GroupBox1.SuspendLayout();
            this.Panel1.SuspendLayout();
            this.SuspendLayout();
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.CboGiaBan);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.CboGiaMua);
            this.GroupBox1.Controls.Add(this.Label25);
            this.GroupBox1.Controls.Add(this.CboHangSanXuat);
            this.GroupBox1.Controls.Add(this.Label1);
            this.GroupBox1.Controls.Add(this.CboQuocGia);
            this.GroupBox1.Controls.Add(this.Label18);
            this.GroupBox1.Controls.Add(this.CboNhom);
            this.GroupBox1.Dock = DockStyle.Fill;
            Point point = new Point(0, 0);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(0x18a, 0xa3);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00f9y chọn";
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            this.Label3.ForeColor = SystemColors.ControlText;
            point = new Point(0xcc, 0x73);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x2c, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x2e;
            this.Label3.Text = "Gi\x00e1 b\x00e1n";
            this.CboGiaBan.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboGiaBan.FormattingEnabled = true;
            point = new Point(0x10b, 0x6f);
            this.CboGiaBan.Location = point;
            this.CboGiaBan.Name = "CboGiaBan";
            size = new Size(0x71, 0x15);
            this.CboGiaBan.Size = size;
            this.CboGiaBan.TabIndex = 0x2d;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            this.Label2.ForeColor = SystemColors.ControlText;
            point = new Point(7, 0x72);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x2e, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x2c;
            this.Label2.Text = "Gi\x00e1 mua";
            this.CboGiaMua.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboGiaMua.FormattingEnabled = true;
            point = new Point(0x5f, 0x6f);
            this.CboGiaMua.Location = point;
            this.CboGiaMua.Name = "CboGiaMua";
            size = new Size(100, 0x15);
            this.CboGiaMua.Size = size;
            this.CboGiaMua.TabIndex = 0x2b;
            this.Label25.AutoSize = true;
            this.Label25.BackColor = Color.Transparent;
            this.Label25.ForeColor = SystemColors.ControlText;
            point = new Point(8, 0x57);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            size = new Size(0x4c, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x2a;
            this.Label25.Text = "H\x00e3ng sản xuất";
            this.CboHangSanXuat.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboHangSanXuat.FormattingEnabled = true;
            point = new Point(0x5f, 0x54);
            this.CboHangSanXuat.Location = point;
            this.CboHangSanXuat.Name = "CboHangSanXuat";
            size = new Size(0x11d, 0x15);
            this.CboHangSanXuat.Size = size;
            this.CboHangSanXuat.TabIndex = 0x29;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            this.Label1.ForeColor = SystemColors.ControlText;
            point = new Point(8, 60);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x2b, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 40;
            this.Label1.Text = "Xuất sứ";
            this.CboQuocGia.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboQuocGia.FormattingEnabled = true;
            point = new Point(0x5f, 0x39);
            this.CboQuocGia.Location = point;
            this.CboQuocGia.Name = "CboQuocGia";
            size = new Size(0x11d, 0x15);
            this.CboQuocGia.Size = size;
            this.CboQuocGia.TabIndex = 0x27;
            this.Label18.AutoSize = true;
            this.Label18.BackColor = Color.Transparent;
            this.Label18.ForeColor = SystemColors.ControlText;
            point = new Point(7, 0x21);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x3e, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x20;
            this.Label18.Text = "Nh\x00f3m h\x00e0ng";
            this.CboNhom.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboNhom.FormattingEnabled = true;
            point = new Point(0x5f, 30);
            this.CboNhom.Location = point;
            this.CboNhom.Name = "CboNhom";
            size = new Size(0x11d, 0x15);
            this.CboNhom.Size = size;
            this.CboNhom.TabIndex = 0x1f;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x135, 3);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x52, 0x18);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x85;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0xde, 3);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x51, 0x18);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 0x84;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            this.Panel1.BackColor = Color.Transparent;
            this.Panel1.Controls.Add(this.CmdCancel);
            this.Panel1.Controls.Add(this.CmdOK);
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 0xa3);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x18a, 0x20);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x86;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x18a, 0xc3);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.GroupBox1);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_DKHangHoa";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-0033";
            this.Text = "IN DANH SACH HANG HOA";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.Panel1.ResumeLayout(false);
            this.ResumeLayout(false);
        }

        public void PrintReport()
        {
            this.Cursor = Cursors.WaitCursor;
            string strConditions = " 1 = 1";
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboGiaMua.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn nguy\x00ean tệ t\x00ednh gi\x00e1 mua h\x00e0ng!", ""));
                this.CboGiaMua.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboGiaBan.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại gi\x00e1 b\x00e1n cần in!", ""));
                this.CboGiaBan.Focus();
            }
            else
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboNhom.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                {
                    strConditions = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(strConditions + " AND H.KhoaNhom = '", this.CboNhom.SelectedValue), "'"));
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboHangSanXuat.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                {
                    strConditions = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(strConditions + " AND H.KhoaHangSanXuat = '", this.CboHangSanXuat.SelectedValue), "'"));
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboQuocGia.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                {
                    strConditions = Conversions.ToString(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(Microsoft.VisualBasic.CompilerServices.Operators.ConcatenateObject(strConditions + " AND H.KhoaQuocGia = '", this.CboQuocGia.SelectedValue), "'"));
                }
                DataTable dataTable = this.objDMHangHoa.ShowListReport(Conversions.ToString(this.CboGiaMua.SelectedValue), Conversions.ToString(this.CboGiaBan.SelectedValue), strConditions);
                Rpt_DMHangHoa hoa = new Rpt_DMHangHoa();
                try
                {
                    hoa.SetDataSource(dataTable);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hoa.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hoa.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hoa.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    hoa.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    hoa.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hoa.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hoa.SetParameterValue(5, modGeneral.Tranlated("DANH MỤC H\x00c0NG H\x00d3A", ""));
                    hoa.SetParameterValue(6, modGeneral.Tranlated("STT", ""));
                    hoa.SetParameterValue(7, modGeneral.Tranlated("Nh\x00f3m h\x00e0ng", ""));
                    hoa.SetParameterValue(8, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                    hoa.SetParameterValue(9, modGeneral.Tranlated("T\x00ean (Tiếng Việt)", ""));
                    hoa.SetParameterValue(10, modGeneral.Tranlated("T\x00ean (Tiếng Anh)", ""));
                    hoa.SetParameterValue(11, modGeneral.Tranlated("Diễn giải", ""));
                    hoa.SetParameterValue(12, modGeneral.Tranlated("ĐVT", ""));
                    hoa.SetParameterValue(13, modGeneral.Tranlated("Tồn min", ""));
                    hoa.SetParameterValue(14, modGeneral.Tranlated("Thuế suất", ""));
                    hoa.SetParameterValue(15, modGeneral.Tranlated("H\x00e3ng sản xuất", ""));
                    hoa.SetParameterValue(0x10, modGeneral.Tranlated("Xuất xứ", ""));
                    hoa.SetParameterValue(0x11, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    hoa.SetParameterValue(0x12, modGeneral.Tranlated("NGƯỜI LẬP", ""));
                    hoa.SetParameterValue(0x13, modGeneral.Tranlated("Gi\x00e1 mua", "") + "(" + this.CboGiaMua.Text.Trim() + ")");
                    hoa.SetParameterValue(20, this.CboGiaBan.Text.Trim());
                    if (modGeneral.H_GIABANBAOGOMTHUE)
                    {
                        hoa.SetParameterValue(0x15, "Y");
                    }
                    else
                    {
                        hoa.SetParameterValue(0x15, "N");
                    }
                    hoa.SetParameterValue(0x16, modGeneral.Tranlated("VAT", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hoa;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        internal virtual ComboBox CboGiaBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboGiaBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboGiaBan = value;
            }
        }

        internal virtual ComboBox CboGiaMua
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboGiaMua;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboGiaMua = value;
            }
        }

        internal virtual ComboBox CboHangSanXuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboHangSanXuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboHangSanXuat = value;
            }
        }

        internal virtual ComboBox CboNhom
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboNhom;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboNhom = value;
            }
        }

        internal virtual ComboBox CboQuocGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboQuocGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboQuocGia = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdCancel = value;
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }
    }
}

